<template>
<div ref="container" class="container">{{ content }}</div>
<input type="text" ref="username" name="txt" id="txt">
<br>
<button @click="getEleHandler">获取元素</button>


</template>
<!-- 
    属性改变 v-bind
    事件 click

-->
<script>
export default{
    data () {
        return {
            content:"内容"
        }
    },
    methods: {
        getEleHandler(){
            console.log(this.$refs.container.innerHTML="Hello");
            console.log(this.$refs.username.value);
        }
    },
}
</script>